package com.yuexun.beilunpatient.ui.contractmanage.model.impl;

import com.yuexun.beilunpatient.base.BaseEntity;
import com.yuexun.beilunpatient.ui.contractmanage.api.ContractmanageApi;
import com.yuexun.beilunpatient.ui.contractmanage.bean.BaseBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.DiagnoseHistoryData;
import com.yuexun.beilunpatient.ui.contractmanage.bean.HospitalizationAdviceBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.HospitalizationRecordBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.InspectBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.OutPatientAdviceBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.RecordSummaryBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.TestBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.VideoBean;
import com.yuexun.beilunpatient.ui.contractmanage.bean.VideoListBean;
import com.yuexun.beilunpatient.ui.contractmanage.model.IContractManageModel;
import com.yuexun.beilunpatient.utils.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by chenss on 2018/11/30.
 */
public class ContractManageModel implements IContractManageModel {

    private ContractmanageApi api;

    public ContractmanageApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(ContractmanageApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<BaseBean<DiagnoseHistoryData>>> inquirePatientDiagnoseHistory(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquirePatientDiagnoseHistory(praise);
    }

    @Override
    public Observable<BaseEntity<HospitalizationRecordBean>> inquireHospitalizationHistory(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquireHospitalizationHistory(praise);
    }

    @Override
    public Observable<BaseEntity<InspectBean>> inquireApplyCheckPageList(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquireApplyCheckPageList(praise);
    }

    @Override
    public Observable<BaseEntity<TestBean>> inquireApplyAssayPageList(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquireApplyAssayPageList(praise);
    }

    @Override
    public Observable<BaseEntity<OutPatientAdviceBean>> inquirePrescriptionInfo(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquirePrescriptionInfo(praise);
    }

    @Override
    public Observable<BaseEntity<HospitalizationAdviceBean>> inquireInstruct(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquireInstruct(praise);
    }

    @Override
    public Observable<VideoListBean> cIcheckList(Map<String, String> praise) {
        api = ApiInstance();
        return api.cIcheckList(praise);
    }

    @Override
    public Observable<VideoBean> cIcheckInfo(Map<String, String> praise) {
        api = ApiInstance();
        return api.cIcheckInfo(praise);
    }

    @Override
    public Observable<BaseEntity<RecordSummaryBean>> summaryOfDischarge(Map<String, String> praise) {
        api = ApiInstance();
        return api.summaryOfDischarge(praise);
    }
}
